home *** CD-ROM | disk | FTP | other *** search
/ Over 1,000 Windows 95 Programs / Over 1000 Windows 95 Programs (Microforum) (Disc 1).iso / 1138 / source.zip / FRMMAIN.FRM < prev    next >
Text File  |  1995-02-14  |  38KB  |  1,174 lines

  1. VERSION 2.00
  2. Begin Form frmmain 
  3.    BackColor       =   &H00FFFFFF&
  4.    Caption         =   "Paperboy"
  5.    ClientHeight    =   3804
  6.    ClientLeft      =   1152
  7.    ClientTop       =   1752
  8.    ClientWidth     =   7512
  9.    ClipControls    =   0   'False
  10.    FontBold        =   -1  'True
  11.    FontItalic      =   0   'False
  12.    FontName        =   "MS Sans Serif"
  13.    FontSize        =   12
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   4548
  17.    Icon            =   FRMMAIN.FRX:0000
  18.    Left            =   1104
  19.    LinkTopic       =   "Form1"
  20.    ScaleHeight     =   3804
  21.    ScaleWidth      =   7512
  22.    Top             =   1056
  23.    Width           =   7608
  24.    Begin CommonDialog dlgFile 
  25.       CancelError     =   -1  'True
  26.       Left            =   2880
  27.       Top             =   720
  28.    End
  29.    Begin PictureBox pictext 
  30.       ClipControls    =   0   'False
  31.       Enabled         =   0   'False
  32.       FontBold        =   0   'False
  33.       FontItalic      =   0   'False
  34.       FontName        =   "Book Antiqua"
  35.       FontSize        =   13.8
  36.       FontStrikethru  =   0   'False
  37.       FontUnderline   =   0   'False
  38.       Height          =   2052
  39.       Left            =   0
  40.       ScaleHeight     =   2028
  41.       ScaleWidth      =   7068
  42.       TabIndex        =   3
  43.       Top             =   1800
  44.       Width           =   7092
  45.    End
  46.    Begin VScrollBar vsbtext 
  47.       Height          =   1932
  48.       Left            =   7200
  49.       TabIndex        =   2
  50.       Top             =   1800
  51.       Value           =   1
  52.       Width           =   252
  53.    End
  54.    Begin ListBox lstsubjects 
  55.       Enabled         =   0   'False
  56.       FontBold        =   0   'False
  57.       FontItalic      =   0   'False
  58.       FontName        =   "MS Sans Serif"
  59.       FontSize        =   7.8
  60.       FontStrikethru  =   0   'False
  61.       FontUnderline   =   0   'False
  62.       Height          =   1560
  63.       Left            =   3600
  64.       TabIndex        =   1
  65.       Top             =   0
  66.       Width           =   3852
  67.    End
  68.    Begin ListBox lstareas 
  69.       Enabled         =   0   'False
  70.       FontBold        =   0   'False
  71.       FontItalic      =   0   'False
  72.       FontName        =   "MS Sans Serif"
  73.       FontSize        =   7.8
  74.       FontStrikethru  =   0   'False
  75.       FontUnderline   =   0   'False
  76.       Height          =   1560
  77.       Left            =   0
  78.       TabIndex        =   0
  79.       Top             =   0
  80.       Width           =   2532
  81.    End
  82.    Begin Menu mnuFile 
  83.       Caption         =   "&File"
  84.       Begin Menu mnuFOPEN 
  85.          Caption         =   "&Open SOUP Packet..."
  86.          Shortcut        =   ^O
  87.       End
  88.       Begin Menu mnubar0 
  89.          Caption         =   "-"
  90.       End
  91.       Begin Menu mnunewfolder 
  92.          Caption         =   "&New Folder..."
  93.       End
  94.       Begin Menu mnudelfolder 
  95.          Caption         =   "&Delete Folder..."
  96.          Enabled         =   0   'False
  97.       End
  98.       Begin Menu mnubar1 
  99.          Caption         =   "-"
  100.       End
  101.       Begin Menu mnusave 
  102.          Caption         =   "&Save/Append Message..."
  103.          Enabled         =   0   'False
  104.          Shortcut        =   ^S
  105.       End
  106.       Begin Menu mnuFPrint 
  107.          Caption         =   "&Print Message"
  108.          Enabled         =   0   'False
  109.          Shortcut        =   ^P
  110.       End
  111.       Begin Menu mnubar3 
  112.          Caption         =   "-"
  113.       End
  114.       Begin Menu mnuFExit 
  115.          Caption         =   "E&xit"
  116.          Shortcut        =   ^Q
  117.       End
  118.    End
  119.    Begin Menu mnuedit 
  120.       Caption         =   "&Edit"
  121.       Begin Menu mnuECopy 
  122.          Caption         =   "&Copy Message to Clipboard"
  123.          Enabled         =   0   'False
  124.          Shortcut        =   ^C
  125.       End
  126.       Begin Menu mnucopytofolder 
  127.          Caption         =   "Copy Message to Folder..."
  128.          Enabled         =   0   'False
  129.          Shortcut        =   ^K
  130.       End
  131.       Begin Menu mnudelfromfolder 
  132.          Caption         =   "&Delete Message from Folder"
  133.          Enabled         =   0   'False
  134.          Shortcut        =   ^D
  135.       End
  136.       Begin Menu mnubar13 
  137.          Caption         =   "-"
  138.       End
  139.       Begin Menu mnufind 
  140.          Caption         =   "&Find..."
  141.          Enabled         =   0   'False
  142.          Shortcut        =   {F2}
  143.       End
  144.       Begin Menu mnufindnext 
  145.          Caption         =   "Find &Next"
  146.          Enabled         =   0   'False
  147.          Shortcut        =   {F3}
  148.       End
  149.       Begin Menu mnubar6 
  150.          Caption         =   "-"
  151.       End
  152.       Begin Menu mnurot13 
  153.          Caption         =   "&Rot 13"
  154.          Enabled         =   0   'False
  155.          Shortcut        =   ^X
  156.       End
  157.    End
  158.    Begin Menu menumessage 
  159.       Caption         =   "&Message"
  160.       Begin Menu mnunewmail 
  161.          Caption         =   "Send &new Mail..."
  162.          Shortcut        =   ^N
  163.       End
  164.       Begin Menu mnureplymail 
  165.          Caption         =   "Reply via &mail..."
  166.          Enabled         =   0   'False
  167.          Shortcut        =   ^R
  168.       End
  169.       Begin Menu mnubar4 
  170.          Caption         =   "-"
  171.       End
  172.       Begin Menu mnuPostMsg 
  173.          Caption         =   "&Post new message to newsgroup..."
  174.          Enabled         =   0   'False
  175.          Shortcut        =   ^U
  176.       End
  177.       Begin Menu mnuFollowUp 
  178.          Caption         =   "Post &Followup to newsgroup..."
  179.          Enabled         =   0   'False
  180.          Shortcut        =   ^F
  181.       End
  182.       Begin Menu mnubar8 
  183.          Caption         =   "-"
  184.       End
  185.       Begin Menu mnuexted 
  186.          Caption         =   "Specify &Editor..."
  187.       End
  188.    End
  189.    Begin Menu mnudisplay 
  190.       Caption         =   "&Display"
  191.       Begin Menu mnufixedpitch 
  192.          Caption         =   "Fixed &Pitch"
  193.          Shortcut        =   ^M
  194.       End
  195.       Begin Menu mnushowheaders 
  196.          Caption         =   "Show &Headers"
  197.          Shortcut        =   ^H
  198.       End
  199.       Begin Menu mnushowlengths 
  200.          Caption         =   "Show &Lengths"
  201.          Enabled         =   0   'False
  202.       End
  203.       Begin Menu mnubar9 
  204.          Caption         =   "-"
  205.       End
  206.       Begin Menu mnufonts 
  207.          Caption         =   "&Fonts"
  208.          Begin Menu mnugroups 
  209.             Caption         =   "&Groups..."
  210.          End
  211.          Begin Menu mnusubjects 
  212.             Caption         =   "&Subjects..."
  213.          End
  214.          Begin Menu mnumessage 
  215.             Caption         =   "&Message Text..."
  216.          End
  217.          Begin Menu mnuquote 
  218.             Caption         =   "&Quoted Text..."
  219.          End
  220.          Begin Menu mnumonofont 
  221.             Caption         =   "Mo&nospaced Text..."
  222.          End
  223.       End
  224.       Begin Menu mnuration 
  225.          Caption         =   "Screen &Ratio..."
  226.       End
  227.       Begin Menu mnubackground 
  228.          Caption         =   "&Background Color..."
  229.       End
  230.    End
  231.    Begin Menu mnuHelp 
  232.       Caption         =   "&Help"
  233.       Begin Menu mnuughbug 
  234.          Caption         =   "Send &Bug Report or Suggestion..."
  235.       End
  236.       Begin Menu mnushowdocs 
  237.          Caption         =   "Doc&umentation"
  238.       End
  239.       Begin Menu mnubar2 
  240.          Caption         =   "-"
  241.       End
  242.       Begin Menu mnuHAbout 
  243.          Caption         =   "&About..."
  244.       End
  245.    End
  246. End
  247. Option Explicit
  248.  
  249. Sub DisableMsgMenus ()
  250. mnuFPrint.Enabled = False
  251. mnuECopy.Enabled = False
  252. mnureplymail.Enabled = False
  253. mnurot13.Enabled = False
  254. mnuFollowUp.Enabled = False
  255. mnuPostMsg.Enabled = False
  256. mnusave.Enabled = False
  257. mnufixedpitch.Enabled = False
  258. mnucopytofolder.Enabled = False
  259. mnushowheaders.Enabled = False
  260. mnudelfromfolder.Enabled = False
  261. mnufind.Enabled = False
  262. mnufindnext.Enabled = False
  263. 'mnu.Enabled = False
  264.  
  265. End Sub
  266.  
  267. Sub EnableMsgMenus ()
  268. mnuFPrint.Enabled = True
  269. mnuECopy.Enabled = True
  270. mnureplymail.Enabled = True
  271. mnurot13.Enabled = True
  272. mnusave.Enabled = True
  273. mnufixedpitch.Enabled = True
  274. mnushowheaders.Enabled = True
  275. mnucopytofolder.Enabled = True
  276. mnufind.Enabled = True
  277. mnufindnext.Enabled = True
  278. If group = 0 Then
  279.     MsgBox "Shouldn't be here", 0, "Internal Error"
  280.     Exit Sub
  281. End If
  282. If IsFolder(group) Then mnudelfromfolder.Enabled = True
  283. If Mid$(fixstr(GetAreaEncoding(group)), 3, 1) = "n" Then
  284.     mnuFollowUp.Enabled = True
  285.     mnuPostMsg.Enabled = True
  286. End If
  287. 'mnu.Enabled = True
  288.  
  289. End Sub
  290.  
  291. Sub Form_Load ()
  292.     DisableMsgMenus
  293.     Form_resize
  294.     Call SetBackgrounds
  295. End Sub
  296.  
  297. Sub Form_resize ()
  298. ' Whenever form is resized, we need to scale all
  299. ' controls appropriately so they fill the new window
  300. Dim horizpercent As Single, vertpercent As Single
  301.  
  302.     horizpercent = Val(GetINI("Window", "HPercent", Str(40)))
  303.     vertpercent = Val(GetINI("Window", "VPercent", Str(30)))
  304.     horizpercent = horizpercent / 100
  305.     vertpercent = vertpercent / 100
  306.  
  307.     lstareas.Top = 0
  308.     lstareas.Left = 0
  309.     lstareas.Width = frmmain.ScaleWidth * horizpercent
  310.     lstareas.Height = frmmain.ScaleHeight * vertpercent
  311.     lstsubjects.Top = 0
  312.     lstsubjects.Left = lstareas.Width
  313.     lstsubjects.Height = lstareas.Height
  314.     lstsubjects.Width = frmmain.ScaleWidth - lstareas.Width
  315.     pictext.Left = 0
  316.     pictext.Top = lstsubjects.Height
  317.     pictext.Width = frmmain.ScaleWidth - vsbtext.Width
  318.     pictext.Height = frmmain.ScaleHeight - lstsubjects.Height
  319.     vsbtext.Left = pictext.Width
  320.     vsbtext.Top = pictext.Top
  321.     vsbtext.Height = pictext.Height
  322. End Sub
  323.  
  324. Function IsQuoted (textline As String)
  325. Dim l As String
  326. l = Left$(textline, 1)
  327. If l = ">" Or l = "<" Or l = ":" Or l = "|" Or l = "]" Or Left$(textline, 10) = "In article" Then IsQuoted = 1 Else IsQuoted = 0
  328. End Function
  329.  
  330. Sub lstareas_click ()
  331. Dim which As Integer
  332. Dim result As Integer
  333. Dim showlengths As Integer
  334. Dim subj1 As String, subj2 As String, subj3 As String
  335.  
  336.     lstsubjects.Clear
  337.     lstsubjects.Enabled = False
  338.     If UCase$(GetINI("Display", "ShowLengths", "N")) = "N" Then
  339.         showlengths = False
  340.     Else
  341.         showlengths = True
  342.     End If
  343.     message = 0
  344.     pictext.Cls
  345.     pictext.Enabled = False
  346.     vsbtext.Enabled = False
  347.     mnudelfolder.Enabled = False
  348.     mnushowlengths.Enabled = True
  349.     group = lstareas.ListIndex + 1
  350.     DisableMsgMenus
  351.     If group = 0 Then Exit Sub
  352.     screen.MousePointer = hourglass
  353.     If IsFolder(group) Then mnudelfolder.Enabled = True
  354.     If Mid$(fixstr(GetAreaEncoding(group)), 3, 1) = "n" And Not IsFolder(group) Then
  355.         mnuPostMsg.Enabled = True
  356.         result = ThreadMsgs(group)
  357.     End If
  358.  
  359.     subj1 = ""
  360.     For which = 1 To GetNumMsgs(group)
  361.         subj2 = fixstr(GetSubject(group, which))
  362.         If UCase$(Left$(subj2, 4)) = "RE: " Then
  363.             While UCase$(Left$(subj2, 4)) = "RE: "
  364.                 subj2 = Mid$(subj2, 5)
  365.             Wend
  366.             subj2 = ">" + subj2
  367.         End If
  368.         'If UCase$(Mid$(subj1, 15)) = UCase$(Mid$(subj2, 15)) Then
  369.         '    subj2 = ">" + subj2
  370.         'Else
  371.         '    subj1 = subj2
  372.         'End If
  373.         
  374.         If showlengths = True Then subj2 = "(" + Format$(GetLength(group, which) / 1024, "0.0") + "KB)" + Chr(9) + subj2
  375.         
  376.         lstsubjects.AddItem subj2
  377.     Next which
  378.  
  379.     lstsubjects.Enabled = True
  380.     screen.MousePointer = NORMAL
  381. End Sub
  382.  
  383. Sub lstsubjects_Click ()
  384.     showmessages
  385. End Sub
  386.  
  387. Sub MakeMessage ()
  388.     'If UCase$(GetINI("Editor", "UseExternalEditor", "Y")) = "N" Then
  389.         'frmmail.Show 1
  390.     'Else
  391.         frmexted.Show 1
  392.     'End If
  393. End Sub
  394.  
  395. Sub mnubackground_Click ()
  396. On Error Resume Next
  397.  
  398.     dlgfile.Flags = CC_RGBINIT 'Or CC_PREVENTFULLOPEN
  399.     'dlgfile.Color = Val(GetINI("Display", "BackColor", Hex$(WINDOW_BACKGROUND)))
  400.     dlgfile.DialogTitle = "Change Background Color"
  401.     dlgfile.Action = DLG_COLOR
  402.     If Err = 0 Then 'Didn't press cancel
  403.         SetINI "Display", "BackColor", dlgfile.Color
  404.         Call SetBackgrounds
  405.     End If
  406. End Sub
  407.  
  408. Sub mnucopytofolder_Click ()
  409.  
  410.     remember (0)
  411.     frmfold.Show 1
  412.     remember (1)
  413. End Sub
  414.  
  415. Sub mnudelfolder_Click ()
  416. Dim foldername As String
  417. Dim whichfolder As Integer
  418. Dim folderfile As String
  419.  
  420.     lstsubjects.Enabled = False
  421.     If group = 0 Then Exit Sub
  422.     foldername = fixstr(GetAreaName(group))
  423.     If IsFolder(group) And MsgBox("Delete folder " + foldername + "?", MB_YESNO + MB_ICONQUESTION + MB_DEFBUTTON2, "Confirm") = IDYES Then
  424.         ' Find folder
  425.         whichfolder = 1
  426.         While GetINI("Folders", "Name" + Format$(whichfolder), "") <> foldername And whichfolder <= NUMFOLDERS
  427.             whichfolder = whichfolder + 1
  428.         Wend
  429.         If whichfolder > NUMFOLDERS Then
  430.             MsgBox "Can't delete folder", 0, "Warning!"
  431.         Else
  432.             ' Delete the folder
  433.             RemoveArea (foldername)
  434.             SetINI "Folders", "Name" + Format$(whichfolder), ""
  435.             folderfile = app.Path + "\FOLDER" + Format$(whichfolder) + ".FOL"
  436.             Kill folderfile
  437.             ' Reread folders
  438.             DoFolders
  439.             Call lstareas_click
  440.         End If
  441.     End If
  442. End Sub
  443.  
  444. Sub mnudelfromfolder_Click ()
  445. Dim result As Integer
  446.     
  447.     remember (0)
  448.     lstsubjects.Enabled = False
  449.     lstsubjects.Clear
  450.     result = DeleteMsg(group, message)
  451.     DllErr result
  452.     DoFolders
  453.     remember (1)
  454. End Sub
  455.  
  456. Sub mnuECopy_Click ()
  457. Dim lineno As Integer
  458. Dim hold As String
  459.  
  460.     If message > 0 Then
  461.         screen.MousePointer = hourglass
  462.         clipboard.Clear
  463.         hold = ""
  464.         GetMsg group, message
  465.         For lineno = 1 To GetNumLines()
  466.             hold = hold + fixstr(GetLine(lineno)) + Chr(13) + Chr(10)
  467.         Next lineno
  468.         clipboard.SetText hold
  469.         screen.MousePointer = default
  470.     End If
  471. End Sub
  472.  
  473. Sub mnuexted_Click ()
  474. frmched.Show 1
  475. End Sub
  476.  
  477. Sub mnuFExit_Click ()
  478.     Dim result As Integer
  479.     If windowstate = NORMAL Then
  480.         ' Update size/position in INI file
  481.         SetINI "Window", "Maximized", "N"
  482.         SetINI "Window", "Top", Str(Int(Top))
  483.         SetINI "Window", "Left", Str(Int(Left))
  484.         SetINI "Window", "Height", Str(Int(Height))
  485.         SetINI "Window", "Width", Str(Int(Width))
  486.     Else If windowstate = MAXIMIZED Then SetINI "Window", "Maximized", "Y"
  487.     End If
  488.  
  489.     SetINI "Fonts", "GroupsName", lstareas.FontName
  490.     SetINI "Fonts", "GroupsSize", Str(lstareas.FontSize)
  491.     SetINI "Fonts", "SubjName", lstsubjects.FontName
  492.     SetINI "Fonts", "SubjSize", Str(lstsubjects.FontSize)
  493.  
  494.     frmmain.Hide     ' This should end sub main
  495. End Sub
  496.  
  497. Sub mnufind_Click ()
  498. Dim srchstring As String
  499. Dim w As finder
  500. Dim result As Integer
  501. Dim tmpstr As String
  502.  
  503.     srchstring = GetINI("Message", "LastSearch", "word")
  504.     srchstring = InputBox$("Enter text to search for", "Find (Experimental/Buggy)", srchstring)
  505.     srchstring = LCase$(srchstring)
  506.     If srchstring <> "" Then
  507.         SetINI "Message", "LastSearch", srchstring
  508.         w.group = lstareas.ListIndex + 1
  509.         w.message = lstsubjects.ListIndex + 1
  510.         'w.lineno = vsbtext.Value + 1
  511.         w.lineno = GetNumLines()    'End of current message
  512.         screen.MousePointer = hourglass
  513.         result = Find(w, srchstring)
  514.         screen.MousePointer = default
  515.         If result = 1 Then
  516.             lstareas.ListIndex = w.group - 1
  517.             lstsubjects.ListIndex = w.message - 1
  518.             mnushowheaders.Checked = True
  519.             showmessages
  520.             tmpstr = Str(w.group) + "," + Str(w.message) + "," + Str(w.lineno) + "out of " + Str(GetNumLines())
  521.             'MsgBox tmpstr, 0, "Found!"
  522.             vsbtext.Value = w.lineno + 2
  523.             MsgBox "Line #" & Format$(w.lineno) + Chr(13) + Chr(10) + fixstr(GetLine(w.lineno)), MB_OK, "Found " & srchstring
  524.         Else
  525.             MsgBox "Not Found: " + srchstring, MB_ICONINFORMATION, "Paperboy Find"
  526.         End If
  527.     End If
  528. End Sub
  529.  
  530. Sub mnufindnext_Click ()
  531. Dim srchstring As String
  532. Dim w As finder
  533. Dim result As Integer
  534.     
  535.     srchstring = GetINI("Message", "LastSearch", "word")
  536.     'srchstring = InputBox$("Enter text to search for", "Find", srchstring)
  537.     srchstring = LCase$(srchstring)
  538.     If srchstring <> "" Then
  539.         SetINI "Message", "LastSearch", srchstring
  540.         w.group = lstareas.ListIndex + 1
  541.         w.message = lstsubjects.ListIndex + 1
  542.         w.lineno = vsbtext.Value + 1
  543.         screen.MousePointer = hourglass
  544.         result = Find(w, srchstring)
  545.         screen.MousePointer = default
  546.         If result = 1 Then
  547.             lstareas.ListIndex = w.group - 1
  548.             lstsubjects.ListIndex = w.message - 1
  549.             showmessages
  550.             MsgBox "Line #" & Format$(w.lineno) + Chr(13) + Chr(10) + fixstr(GetLine(w.lineno)), MB_OK, "Found " & srchstring
  551.             'If mnushowheaders.Checked = True Then
  552.             '    vsbtext.Value = w.lineno - 1 + 2
  553.             'Else
  554.             '    vsbtext.Value = w.lineno - endofheaders() - 1 + 2
  555.             'End If
  556.         Else
  557.             MsgBox "Not Found: " + srchstring, MB_ICONINFORMATION, "Paperboy Find"
  558.         End If
  559.     End If
  560.  
  561. End Sub
  562.  
  563. Sub mnufixedpitch_Click ()
  564.  
  565.     mnufixedpitch.Checked = Not mnufixedpitch.Checked
  566.     If mnufixedpitch.Checked Then
  567.         SetINI "Display", "FixedPitch", "Y"
  568.     Else
  569.         SetINI "Display", "FixedPitch", "N"
  570.     End If
  571.     
  572.     showmessages
  573. End Sub
  574.  
  575. Sub mnuFollowUp_Click ()
  576. Dim subj As String
  577.     
  578.     remember (0)
  579.     If fixstr(GetHeader("Followup-To")) <> "" Then
  580.         mailsendto = fixstr(GetHeader("Followup-To"))
  581.     Else
  582.         mailsendto = fixstr(GetHeader("Newsgroups"))
  583.     End If
  584.     mailreferences = fixstr(GetHeader("Message-ID")) + " " + fixstr(GetHeader("References"))
  585.     subj = fixstr(GetHeader("Subject"))
  586.     If Left$(subj, 4) <> "Re: " Then subj = "Re: " & subj
  587.     mailsubject = subj
  588.     replytype = 2
  589.     MakeMessage
  590.     remember (1)
  591. End Sub
  592.  
  593. Sub mnuFOPEN_Click ()
  594. Dim Filename As String
  595.     
  596.     Filename = GetINI("Files", "Last SOUP Packet", app.Path + "\SAMPLE.ZIP")
  597.     On Error Resume Next
  598.  
  599.     Err = 0
  600.     dlgfile.Flags = OFN_FILEMUSTEXIST
  601.     dlgfile.Filename = Filename
  602.     dlgfile.Filter = "Soup Packet (*.ZIP)|*.ZIP|SOUP Areas File (AREAS.)|AREAS"
  603.     dlgfile.InitDir = CurDir$
  604.     dlgfile.DialogTitle = "Open SOUP AREAS File"
  605.     dlgfile.Action = DLG_FILE_OPEN
  606.     If Err = 0 Then 'Didn't press cancel
  607.         Filename = dlgfile.Filename
  608.         SetINI "Files", "Last SOUP Packet", Filename
  609.         If GetINI("Files", "AREASTimestamp", "None") = FileDateTime(Filename) Then Persist = True Else Persist = False' Same packet
  610.         SetINI "Files", "AREASTimestamp", FileDateTime(Filename)
  611.         OpenAreas (Filename)
  612.     End If
  613. End Sub
  614.  
  615. Sub mnuFPrint_Click ()
  616. Dim lineno As Integer
  617. Dim Max As Integer
  618. Dim subject As String
  619. Dim author As String
  620. Dim organization As String
  621. Dim textline As String
  622. Dim inquote As Integer
  623. Dim leftmargin As String
  624. Dim fixedpitch As Integer
  625. Dim holdbold As Integer
  626. Dim firstline As Integer
  627.  
  628. inquote = 0
  629. leftmargin = " "
  630. screen.MousePointer = hourglass
  631.  
  632. If message > 0 Then
  633.     If mnushowheaders.Checked = True Then
  634.         firstline = 1
  635.     Else
  636.         firstline = endofheaders()
  637.     End If
  638.  
  639.     If mnufixedpitch.Checked = True Then
  640.         fixedpitch = 1
  641.         printer.FontName = GetINI("Fonts", "MonoName", "Arial")
  642.         printer.FontSize = Val(GetINI("Fonts", "MonoSize", "12"))
  643.         printer.FontBold = Val(GetINI("Fonts", "MonoBold", "-1"))
  644.         printer.FontItalic = Val(GetINI("Fonts", "MonoItalic", "0"))
  645.     Else
  646.         fixedpitch = 0
  647.         printer.FontName = GetINI("Fonts", "TextName", "Arial")
  648.         printer.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  649.         printer.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  650.         printer.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  651.     End If
  652.  
  653.     lineno = 0
  654.     Max = GetNumLines() - firstline + 3
  655.  
  656.     While lineno <= Max
  657.     If lineno > 2 Then
  658.         textline = fixstr(GetLine(lineno + firstline - 3))
  659.         If IsQuoted(textline) And Not fixedpitch Then
  660.             If inquote = 0 Then
  661.                 inquote = 1
  662.                 printer.FontName = GetINI("Fonts", "QuoteName", "Arial")
  663.                 printer.FontSize = Val(GetINI("Fonts", "QuoteSize", "8"))
  664.                 printer.FontBold = Val(GetINI("Fonts", "QuoteBold", "0"))
  665.                 printer.FontItalic = Val(GetINI("Fonts", "QuoteItalic", "-1"))
  666.             End If
  667.         ElseIf inquote = 1 Then
  668.             inquote = 0
  669.             printer.FontName = GetINI("Fonts", "TextName", "Arial")
  670.             printer.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  671.             printer.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  672.             printer.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  673.         End If
  674.         printer.Print leftmargin; textline
  675.     ElseIf lineno = 0 Then
  676.         ' Print pretty header stuff
  677.         subject = fixstr(GetSubject(group, message))
  678.         holdbold = printer.FontBold
  679.         printer.FontBold = True
  680.         printer.CurrentX = (printer.ScaleWidth - printer.TextWidth(subject)) / 2
  681.         printer.Print subject
  682.         printer.FontBold = holdbold
  683.     ElseIf lineno = 1 Then
  684.         author = fixstr(GetAuthor(group, message))
  685.         author = " " + extractusername(author) + " "
  686.         printer.Print author;
  687.         organization = fixstr(GetHeader("Organization"))
  688.         organization = " " + organization + " "
  689.         printer.CurrentX = printer.ScaleWidth - printer.TextWidth(organization)
  690.         printer.Print organization
  691.     ElseIf lineno = 2 Then
  692.         printer.Line -Step(printer.ScaleWidth, 0)
  693.         printer.CurrentX = 0
  694.     End If
  695.     lineno = lineno + 1
  696.     Wend
  697. End If
  698.  
  699. printer.EndDoc
  700. screen.MousePointer = default
  701. End Sub
  702.  
  703. Sub mnugroups_Click ()
  704.     dlgfile.FontName = lstareas.FontName
  705.     dlgfile.FontSize = lstareas.FontSize
  706.     dlgfile.DialogTitle = "Group Font"
  707.     dlgfile.Flags = CF_SCREENFONTS
  708.     On Error Resume Next
  709.     dlgfile.Action = DLG_FONT
  710.     If Err = 0 Then
  711.         lstareas.FontName = dlgfile.FontName
  712.         lstareas.FontSize = dlgfile.FontSize
  713.     End If
  714. End Sub
  715.  
  716. Sub mnuHAbout_Click ()
  717.     frmabout.Show 1
  718. End Sub
  719.  
  720. Sub mnumessage_Click ()
  721.     dlgfile.FontName = GetINI("Fonts", "TextName", "Arial")
  722.     dlgfile.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  723.     dlgfile.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  724.     dlgfile.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  725.     dlgfile.Color = Val(GetINI("Fonts", "TextColor", pictext.ForeColor))
  726.     dlgfile.DialogTitle = "Message Text Font"
  727.     dlgfile.Flags = CF_SCREENFONTS + CF_EFFECTS
  728.     On Error Resume Next
  729.     dlgfile.Action = DLG_FONT
  730.     If Err = 0 Then
  731.         SetINI "Fonts", "TextName", dlgfile.FontName
  732.         SetINI "Fonts", "TextSize", dlgfile.FontSize
  733.         SetINI "Fonts", "TextBold", dlgfile.FontBold
  734.         SetINI "Fonts", "TextItalic", dlgfile.FontItalic
  735.         SetINI "Fonts", "TextColor", dlgfile.Color
  736.         pictext_paint
  737.     End If
  738. End Sub
  739.  
  740. Sub mnumonofont_Click ()
  741.     dlgfile.FontName = GetINI("Fonts", "MonoName", "Arial")
  742.     dlgfile.FontSize = Val(GetINI("Fonts", "MonoSize", "12"))
  743.     dlgfile.FontBold = Val(GetINI("Fonts", "MonoBold", "0"))
  744.     dlgfile.FontItalic = Val(GetINI("Fonts", "MonoItalic", "0"))
  745.     dlgfile.DialogTitle = "Monospaced Text Font"
  746.     dlgfile.Flags = CF_SCREENFONTS Or CF_FIXEDPITCHONLY
  747.     On Error Resume Next
  748.     dlgfile.Action = DLG_FONT
  749.     If Err = 0 Then
  750.         SetINI "Fonts", "MonoName", dlgfile.FontName
  751.         SetINI "Fonts", "MonoSize", dlgfile.FontSize
  752.         SetINI "Fonts", "MonoBold", dlgfile.FontBold
  753.         SetINI "Fonts", "MonoItalic", dlgfile.FontItalic
  754.         pictext_paint
  755.     End If
  756.  
  757. End Sub
  758.  
  759. Sub mnunewfolder_Click ()
  760. Dim foldername As String
  761.  
  762.     foldername = InputBox$("Folder Name", "New Folder")
  763.     CreateFolder (foldername)
  764.     lstareas_click
  765. End Sub
  766.  
  767. Sub mnunewmail_Click ()
  768.     remember (0)
  769.     mailreferences = ""
  770.     mailsendto = ""
  771.     mailsubject = ""
  772.     replytype = 1
  773.     MakeMessage
  774.     remember (1)
  775. End Sub
  776.  
  777. Sub mnuPostMsg_Click ()
  778.     remember (0)
  779.     mailsubject = ""
  780.     mailreferences = ""
  781.     mailsendto = fixstr(GetAreaName(group))
  782.     replytype = 2
  783.     MakeMessage
  784.     remember (1)
  785. End Sub
  786.  
  787. Sub mnuquote_Click ()
  788.     dlgfile.FontName = GetINI("Fonts", "QuoteName", "Arial")
  789.     dlgfile.FontSize = Val(GetINI("Fonts", "QuoteSize", "10"))
  790.     dlgfile.FontBold = Val(GetINI("Fonts", "QuoteBold", "0"))
  791.     dlgfile.FontItalic = Val(GetINI("Fonts", "QuoteItalic", "-1"))
  792.     dlgfile.Color = Val(GetINI("Fonts", "QuoteColor", Format$(QBColor(8))))
  793.     dlgfile.DialogTitle = "Quoted Text Font"
  794.     dlgfile.Flags = CF_SCREENFONTS + CF_EFFECTS
  795.     On Error Resume Next
  796.     dlgfile.Action = DLG_FONT
  797.     If Err = 0 Then
  798.         SetINI "Fonts", "QuoteName", dlgfile.FontName
  799.         SetINI "Fonts", "QuoteSize", dlgfile.FontSize
  800.         SetINI "Fonts", "QuoteBold", dlgfile.FontBold
  801.         SetINI "Fonts", "QuoteItalic", dlgfile.FontItalic
  802.         SetINI "Fonts", "QuoteColor", dlgfile.Color
  803.         pictext_paint
  804.     End If
  805.  
  806. End Sub
  807.  
  808. Sub mnuration_Click ()
  809.     frmratio.Show 1
  810.     Form_resize
  811. End Sub
  812.  
  813. Sub mnureplymail_Click ()
  814. Dim subj As String
  815.  
  816.     remember (0)
  817.     If Len(fixstr(GetHeader("Reply-To"))) > 2 Then
  818.         mailsendto = fixstr(GetHeader("Reply-To"))
  819.     Else
  820.         mailsendto = fixstr(GetHeader("From"))
  821.     End If
  822.     subj = fixstr(GetHeader("Subject"))
  823.     If Left$(subj, 4) <> "Re: " Then subj = "Re: " & subj
  824.     mailsubject = subj
  825.     mailreferences = fixstr(GetHeader("Message-ID")) + " " + fixstr(GetHeader("References"))
  826.     replytype = 1
  827.     MakeMessage
  828.     remember (1)
  829. End Sub
  830.  
  831. Sub mnurot13_Click ()
  832.     Rot13Msg
  833.     vsbtext_change
  834. End Sub
  835.  
  836. Sub mnusave_Click ()
  837. Dim Filename As String
  838. Dim fileno, lineno As Integer
  839.  
  840.     remember (0)
  841.     Filename = GetINI("Files", "Last Saved to", "NEWS.TXT")
  842.     On Error Resume Next
  843.  
  844.     Err = 0
  845.     dlgfile.Flags = OFN_NOREADONLYRETURN
  846.     dlgfile.InitDir = app.Path
  847.     'dlgfile.DefaultExt = "TXT"
  848.     dlgfile.Filename = Filename
  849.     dlgfile.Filter = "All Files (*.*)|*.*|Text Files (*.txt)|*.txt"
  850.     dlgfile.DialogTitle = "Save Message To"
  851.     dlgfile.Action = DLG_FILE_OPEN
  852.  
  853.     If dlgfile.Filename <> "" And Err = 0 Then
  854.         screen.MousePointer = hourglass
  855.         Filename = dlgfile.Filename
  856.         SetINI "Files", "Last Saved to", Filename
  857.         fileno = FreeFile
  858.         Open Filename For Append As fileno
  859.         GetMsg group, message
  860.         For lineno = 1 To GetNumLines()
  861.             Print #fileno, fixstr(GetLine(lineno))
  862.         Next lineno
  863.         Close fileno
  864.         screen.MousePointer = default
  865.     End If
  866.     remember (1)
  867. End Sub
  868.  
  869. Sub mnushowdocs_Click ()
  870. Dim cmdstr As String
  871. Dim fname As String
  872. Dim x As Integer
  873.  
  874.     fname = app.Path + "\PAPERBOY.WRI"
  875.     If fileexists(fname) Then
  876.         cmdstr = "write " + fname
  877.         x = Shell(cmdstr, 3)
  878.     Else
  879.         MsgBox "Couldn't find " + fname, MB_ICONEXCLAMATION, "Documentation File Not Found"
  880.     End If
  881. End Sub
  882.  
  883. Sub mnushowheaders_Click ()
  884.  
  885.     mnushowheaders.Checked = Not mnushowheaders.Checked
  886.     If mnushowheaders.Checked Then
  887.         SetINI "Display", "ShowHeaders", "Y"
  888.     Else
  889.         SetINI "Display", "ShowHeaders", "N"
  890.     End If
  891.     
  892.     showmessages
  893. End Sub
  894.  
  895. Sub mnushowlengths_Click ()
  896.     mnushowlengths.Checked = Not mnushowlengths.Checked
  897.     If mnushowlengths.Checked Then
  898.         SetINI "Display", "ShowLengths", "Y"
  899.     Else
  900.         SetINI "Display", "ShowLengths", "N"
  901.     End If
  902.     
  903.     remember (0)
  904.     lstareas_click
  905.     remember (1)
  906. End Sub
  907.  
  908. Sub mnusubjects_Click ()
  909.     dlgfile.FontName = lstsubjects.FontName
  910.     dlgfile.FontSize = lstsubjects.FontSize
  911.     dlgfile.DialogTitle = "Subjects Font"
  912.     dlgfile.Flags = CF_SCREENFONTS
  913.     On Error Resume Next
  914.     dlgfile.Action = DLG_FONT
  915.     If Err = 0 Then
  916.         lstsubjects.FontName = dlgfile.FontName
  917.         lstsubjects.FontSize = dlgfile.FontSize
  918.     End If
  919. End Sub
  920.  
  921. Sub mnuughbug_Click ()
  922.     remember (0)
  923.     mailreferences = ""
  924.     mailsendto = "vart@clark.net"
  925.     mailsubject = "Paperboy " + PaperboyVersion + " Bug/Suggestion"
  926.     replytype = 1
  927.     MakeMessage
  928.     remember (1)
  929. End Sub
  930.  
  931. Sub pictext_paint ()
  932.     If message > 0 Then vsbtext_change Else Call ShowSplash
  933. End Sub
  934.  
  935. Sub remember (op As Integer) '0=push, 1=pop
  936. Static grp As Integer
  937. Static msg As Integer
  938.  
  939.     If op = 0 Then ' Push it
  940.         grp = lstareas.ListIndex
  941.         msg = lstsubjects.ListIndex
  942.     ElseIf op = 1 Then 'Pop it
  943.         If lstareas.ListIndex <> grp And grp < lstareas.ListCount Then lstareas.ListIndex = grp
  944.         If lstsubjects.ListIndex <> msg And msg < lstsubjects.ListCount Then lstsubjects.ListIndex = msg
  945.         If vsbtext.Enabled Then vsbtext.SetFocus
  946.     End If
  947. End Sub
  948.  
  949. Sub SetBackgrounds ()
  950. Dim Bcolor As Long
  951.  
  952.     Bcolor = Val(GetINI("Display", "BackColor", Format$(WINDOW_BACKGROUND)))
  953.     lstareas.BackColor = Bcolor
  954.     lstsubjects.BackColor = Bcolor
  955.     pictext.BackColor = Bcolor
  956.     pictext_paint
  957. End Sub
  958.  
  959. Sub showmessages ()
  960. Dim firstline As Integer
  961.  
  962.     message = lstsubjects.ListIndex + 1
  963.     If group = 0 Or message = 0 Then Exit Sub
  964.  
  965.     GetMsg group, message
  966.     
  967.     If GetNumLines() > 0 Then
  968.         pictext.Enabled = True
  969.         vsbtext.Enabled = True
  970.         vsbtext.SetFocus
  971.         EnableMsgMenus
  972.         If fixstr(GetHeader("Followup-To")) = "poster" Then mnuFollowUp.Enabled = False
  973.         If fixstr(GetHeader("Followup-To")) = "/dev/null" Then mnuFollowUp.Enabled = False
  974.         vsbtext.Min = 0
  975.         If mnushowheaders.Checked = True Then
  976.             firstline = 1
  977.         Else
  978.             firstline = endofheaders()
  979.         End If
  980.         vsbtext.Max = GetNumLines() - firstline + 3
  981.         ' Don't repaint twice
  982.         If vsbtext.Value = vsbtext.Min Then vsbtext_change Else vsbtext.Value = vsbtext.Min
  983.     End If
  984. End Sub
  985.  
  986. Sub ShowSplash ()
  987. Dim fonthold As Single
  988. Dim fontcolor As Long
  989. Dim showtext As String
  990.  
  991.     pictext.Cls
  992.     pictext.FontName = GetINI("Fonts", "TextName", "Arial")
  993.     pictext.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  994.     pictext.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  995.     pictext.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  996.     fonthold = pictext.FontSize
  997.     fontcolor = pictext.ForeColor
  998.     pictext.FontSize = pictext.FontSize * 5
  999.     pictext.CurrentY = (pictext.ScaleHeight - pictext.TextHeight("Paperboy")) / 2
  1000.     pictext.CurrentX = (pictext.ScaleWidth - pictext.TextWidth("Paperboy")) / 2
  1001.     pictext.ForeColor = BUTTON_SHADOW
  1002.     pictext.Print "Paperboy"
  1003.     pictext.CurrentX = (pictext.ScaleWidth - pictext.TextWidth("Paperboy")) / 2
  1004.     pictext.CurrentY = (pictext.ScaleHeight - pictext.TextHeight("Paperboy")) / 2
  1005.     pictext.CurrentX = pictext.CurrentX - pictext.TextWidth("Paperboy") / 200
  1006.     pictext.CurrentY = pictext.CurrentY - pictext.TextWidth("Paperboy") / 200
  1007.     pictext.ForeColor = BUTTON_FACE
  1008.     pictext.Print "Paperboy"
  1009.     pictext.FontSize = fonthold
  1010.     pictext.CurrentX = (pictext.ScaleWidth - pictext.TextWidth("Version " & PaperboyVersion)) / 2
  1011.     pictext.Print "Version " & PaperboyVersion
  1012.     showtext = "⌐ 1995 Michael H. Vartanian "
  1013.     pictext.CurrentY = pictext.ScaleHeight - pictext.TextHeight(showtext) * 2
  1014.     pictext.CurrentX = pictext.ScaleWidth - pictext.TextWidth(showtext)
  1015.     pictext.Print showtext
  1016.     showtext = "vart@clark.net "
  1017.     pictext.CurrentY = pictext.ScaleHeight - pictext.TextHeight(showtext)
  1018.     pictext.CurrentX = pictext.ScaleWidth - pictext.TextWidth(showtext)
  1019.     pictext.Print showtext
  1020.     pictext.ForeColor = fontcolor
  1021. End Sub
  1022.  
  1023. Sub vsbtext_change ()
  1024. Dim lineno As Integer
  1025. Dim Max As Integer
  1026. Dim subject As String
  1027. Dim author As String
  1028. Dim organization As String
  1029. Dim textline As String
  1030. Dim inquote As Integer
  1031. Dim leftmargin As String
  1032. Dim fixedpitch As Integer
  1033. Dim holdbold As Integer
  1034. Dim firstline As Integer
  1035.  
  1036. inquote = 0
  1037. leftmargin = " "
  1038. pictext.Cls
  1039.  
  1040. If message > 0 Then
  1041.     If mnushowheaders.Checked = True Then
  1042.         firstline = 1
  1043.     Else
  1044.         firstline = endofheaders()
  1045.     End If
  1046.  
  1047.     If mnufixedpitch.Checked = True Then
  1048.         fixedpitch = 1
  1049.         pictext.FontName = GetINI("Fonts", "MonoName", "Courier New")
  1050.         pictext.FontSize = Val(GetINI("Fonts", "MonoSize", "12"))
  1051.         pictext.FontBold = Val(GetINI("Fonts", "MonoBold", "-1"))
  1052.         pictext.FontItalic = Val(GetINI("Fonts", "MonoItalic", "0"))
  1053.     Else
  1054.         fixedpitch = 0
  1055.         pictext.FontName = GetINI("Fonts", "TextName", "Arial")
  1056.         pictext.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  1057.         pictext.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  1058.         pictext.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  1059.         pictext.ForeColor = Val(GetINI("Fonts", "TextColor", pictext.ForeColor))
  1060.     End If
  1061.  
  1062.     lineno = vsbtext.Value
  1063.     Max = GetNumLines() - firstline + 3
  1064.  
  1065.     While lineno <= Max And pictext.CurrentY <= pictext.ScaleHeight
  1066.     If lineno > 2 Then
  1067.         textline = fixstr(GetLine(lineno + firstline - 3))
  1068.         If IsQuoted(textline) And Not fixedpitch Then
  1069.             If inquote = 0 Then
  1070.                 inquote = 1
  1071.                 pictext.FontName = GetINI("Fonts", "QuoteName", "Arial")
  1072.                 pictext.FontSize = Val(GetINI("Fonts", "QuoteSize", "10"))
  1073.                 pictext.FontBold = Val(GetINI("Fonts", "QuoteBold", "0"))
  1074.                 pictext.FontItalic = Val(GetINI("Fonts", "QuoteItalic", "-1"))
  1075.                 pictext.ForeColor = Val(GetINI("Fonts", "QuoteColor", Format$(QBColor(8))))
  1076.             End If
  1077.         ElseIf inquote = 1 Then
  1078.             inquote = 0
  1079.             pictext.FontName = GetINI("Fonts", "TextName", "Arial")
  1080.             pictext.FontSize = Val(GetINI("Fonts", "TextSize", "12"))
  1081.             pictext.FontBold = Val(GetINI("Fonts", "TextBold", "0"))
  1082.             pictext.FontItalic = Val(GetINI("Fonts", "TextItalic", "0"))
  1083.             pictext.ForeColor = Val(GetINI("Fonts", "TextColor", pictext.ForeColor))
  1084.         End If
  1085.         pictext.Print leftmargin; textline
  1086.     ElseIf lineno = 0 Then
  1087.         ' Print pretty header stuff
  1088.         subject = fixstr(GetSubject(group, message))
  1089.         holdbold = pictext.FontBold
  1090.         pictext.FontBold = True
  1091.         pictext.CurrentX = (pictext.ScaleWidth - pictext.TextWidth(subject)) / 2
  1092.         pictext.Print subject
  1093.         pictext.FontBold = holdbold
  1094.     ElseIf lineno = 1 Then
  1095.         author = fixstr(GetAuthor(group, message))
  1096.         author = " " + extractusername(author) + " "
  1097.         pictext.Print author;
  1098.         organization = fixstr(GetHeader("Organization"))
  1099.         organization = " " + organization + " "
  1100.         pictext.CurrentX = pictext.ScaleWidth - pictext.TextWidth(organization)
  1101.         pictext.Print organization
  1102.     ElseIf lineno = 2 Then
  1103.         pictext.Line -Step(pictext.ScaleWidth, 0)
  1104.         pictext.CurrentX = 0
  1105.     End If
  1106.     lineno = lineno + 1
  1107.     Wend
  1108.     ' Calculate what a page is
  1109.     If pictext.CurrentY <= pictext.ScaleHeight Then
  1110.     'If lineno > Max Then
  1111.         ' we bottomed out
  1112.         'vsbtext.LargeChange = 1
  1113.         vsbtext.Max = vsbtext.Value 'Bottom out the scrollbar
  1114.         'vsbtext.Value = vsbtext.Max
  1115.     Else ' how much to get to next page
  1116.         holdbold = lineno - vsbtext.Value - 1
  1117.         If holdbold > 0 Then vsbtext.LargeChange = holdbold
  1118.     End If
  1119. End If
  1120. End Sub
  1121.  
  1122. Sub vsbtext_KeyPress (keyascii As Integer)
  1123.     If message > 0 Then
  1124.         If keyascii = 32 Then
  1125.             'space pressed
  1126.             If vsbtext.Value >= vsbtext.Max Then
  1127.                 If lstsubjects.ListIndex >= (lstsubjects.ListCount - 1) Then
  1128.                     'Next group
  1129.                     If lstareas.ListIndex < (lstareas.ListCount - 1) Then
  1130.                             lstareas.ListIndex = lstareas.ListIndex + 1
  1131.                             If lstsubjects.ListCount > 0 Then lstsubjects.ListIndex = 0
  1132.                     Else
  1133.                             'Do nothing (end of groups)
  1134.                             lstareas.ListIndex = lstareas.ListIndex
  1135.                     End If
  1136.                 Else
  1137.                     'Next message
  1138.                     lstsubjects.ListIndex = lstsubjects.ListIndex + 1
  1139.                 End If
  1140.             Else
  1141.                 ' Page down
  1142.                 If vsbtext.Value + vsbtext.LargeChange >= vsbtext.Max Then vsbtext.Value = vsbtext.Max Else vsbtext.Value = vsbtext.Value + vsbtext.LargeChange
  1143.             End If
  1144.         End If 'space
  1145.  
  1146.         If keyascii = Asc("n") Or keyascii = Asc("N") Then
  1147.             ' Next message
  1148.             If lstsubjects.ListIndex >= (lstsubjects.ListCount - 1) Then
  1149.                 'Next group
  1150.                 If lstareas.ListIndex < (lstareas.ListCount - 1) Then
  1151.                         lstareas.ListIndex = lstareas.ListIndex + 1
  1152.                         If lstsubjects.ListCount > 0 Then lstsubjects.ListIndex = 0
  1153.                 Else
  1154.                         'Do nothing (end of groups)
  1155.                         lstareas.ListIndex = lstareas.ListIndex
  1156.                 End If
  1157.             Else
  1158.                 'Next message
  1159.                 lstsubjects.ListIndex = lstsubjects.ListIndex + 1
  1160.             End If
  1161.         End If ' N or n
  1162.  
  1163.         If keyascii = Asc("p") Or keyascii = Asc("P") Then
  1164.             ' Previous message
  1165.             If lstsubjects.ListIndex > 0 Then lstsubjects.ListIndex = lstsubjects.ListIndex - 1
  1166.         End If ' P or p
  1167.     End If ' message > 0
  1168. End Sub
  1169.  
  1170. Sub vsbtext_Scroll ()
  1171.     vsbtext_change
  1172. End Sub
  1173.  
  1174.